package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.BillBean;
import com.common.retrofit.entity.bean.ShopCarBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class BillListMethods extends BaseMethods {

    private static BillListMethods m_ins = null;

    public static BillListMethods getInstance() {
        if (m_ins == null) {
            synchronized (BillListMethods.class) {
                if (m_ins == null) {
                    m_ins = new BillListMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
            return "My/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }

    // 获取首页数据
    public void billList(Subscriber<BillBean> subscriber, int uid, String hashid , int type, int  page) {  // type 类型 1未开票 2已开票 Int类型 必填)
        Observable observable = initService().billList(System.currentTimeMillis()+"",
                "551d6d766a0730f6045c9766488421cd",uid,hashid, type,page);
        toSubscribe(observable, subscriber);
    }
}
